export function initCart() {
	if(!uni.getStorageSync("cartNum")) {
		uni.setStorageSync("cartNum", 0);
		uni.setStorageSync("shoppingCart", []);
	}
}

// 处理购物车tabbar图标数字角标
export function handleSubscript() {
	const cartNum = uni.getStorageSync('cartNum');
	if (cartNum != 0) {
		uni.setTabBarBadge({
			index: 2,
			text: cartNum.toString()
		})
	} else {
		uni.removeTabBarBadge({
			index: 2,
		});
	}
}